package com.my.test.socket;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.InetAddress;
import java.net.Socket;

public class Client
{
Socket socket;
BufferedReader in;
PrintWriter out;

public Client()
{
try
{
socket = new Socket(InetAddress.getLocalHost(), 4433);
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(socket.getOutputStream(),true);
BufferedReader line = new BufferedReader(new InputStreamReader(System.in));

out.println(line.readLine());
String str = in.readLine();
out.flush();
System.out.println(str);
line.close();
out.close();
in.close();
socket.close();
}
catch (IOException e)
{}
}

public static void main(String[] args)
{
new Client();
}
} 